using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace MagicAttributeTest
{
  public partial class PlayerControl : UserControl
  {
    public MagicPlayer Player;

    public PlayerControl()
    {
      InitializeComponent();
    }

    public void UpdateGUI()
    {
      lbHand.Items.Clear();
      foreach (Permanent permanent in Player.Hand)
      {
        lbHand.Items.Add(permanent);
      }

      lbLibrary.Items.Clear();
      foreach (Permanent permanent in Player.Library)
      {
        lbLibrary.Items.Add(permanent);
      }

      lbGraveyard.Items.Clear();
      foreach (Permanent permanent in Player.Graveyard)
      {
        lbGraveyard.Items.Add(permanent);
      }
    }

    private void lbHand_DoubleClick(object sender, EventArgs e)
    {
    //  Permanent permanent = (Permanent)lbHand.SelectedItem;
    //  StartPlayAction action = new StartPlayAction();
    //  action.ActionType = GameActionType.StartPlay;
    //  action.CardToBePlayed = permanent;
    //  action.Costs = permanent.Original.CastingCosts.GetCopyCosts();
    //  action.Player = Global.GuiPlayer;
    //  Global.InitiateGameAction(action);
    }
  }
}
